UP | HOME

Phase Plot

Table of Contents

Phase plot is a vector plot that has phase space (? state space) quantities on the axes and vectors represent their derivatives. Paths connecting the vectors represent the path taken by a system starting or on any point/state of the path.

It is very useful for visualizing Differential Equations (ODE upto 2nd order)

1. Simple Harmonic Oscillator

equation:

\(m u'' + k u' = 0\)

convert this to set of two first order DE:

\(u' = v\) \(v' = -\frac k m u\)

Here the state space is \((u, v)\) and the derivative of this is \((u', v')\)

plotdf takes following arguments:

  • the derivative (or derivative vector)
  • state variable or state vector

and other optional parameters:

  • [parameters, "u=u0, v=v0"] Starting condition
  • [sliders, "u=a:b"] Slider for a variable giving range
  • (Details at Maxima Docs 22.6)

    < Collapse code block> Expand code block
    plotdf([v,-k*u/m], [u,v], [parameters,"m=2,k=2"],
              [sliders,"m=1:5"], [trajectory_at,6,0])$
    

2. Damped Pendulum

< Collapse code block> Expand code block
plotdf([w,-g*sin(a)/l - b*w/m/l], [a,w],
        [parameters,"g=9.8,l=0.5,m=0.3,b=0.05"],
        [trajectory_at,1.05,-9],[tstep,0.01],
        [a,-10,2], [w,-14,14], [direction,forward],
        [nsteps,300], [sliders,"m=0.1:1"], [versus_t,1])

3. Plotting Potential Field

< Collapse code block> Expand code block
V: 900/((x+1)^2+y^2)^(1/2)-900/((x-1)^2+y^2)^(1/2)$
ploteq(V,[x,-2,2],[y,-2,2],[fieldlines,"blue"])$

You can send your feedback, queries here